load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary")
load("@fbcode_macros//build_defs:thrift_library.bzl", "thrift_library")

oncall("fboss_platform")

thrift_library(
    name = "showtech_config",
    languages = [
        "cpp2",
    ],
    thrift_cpp2_options = ["json"],
    thrift_srcs = {"showtech_config.thrift": []},
)

cpp_binary(
    name = "showtech",
    srcs = [
        "FanImpl.cpp",
        "I2cHelper.cpp",
        "Main.cpp",
        "PsuHelper.cpp",
        "Utils.cpp",
    ],
    deps = [
        "fbsource//third-party/fmt:fmt",
        "fbsource//third-party/re2:re2",
        ":showtech_config-cpp2-types",
        "//fboss/lib:common_file_utils",
        "//fboss/lib:gpiod_line",
        "//fboss/lib/i2c:i2c_ctrl",
        "//fboss/platform/config_lib:config_lib",
        "//fboss/platform/fan_service/if:fan_service-cpp2-types",
        "//fboss/platform/helpers:init_cli",
        "//fboss/platform/helpers:platform_utils",
        "//folly:string",
        "//folly/logging:logging",
        "//thrift/lib/cpp2/protocol:protocol",
    ],
    external_deps = [
        "CLI11",
        ("libgpiod", None, "gpiod"),
    ],
)
